const express = require('express');
const router = express.Router();
const { getAllCoupons, receiveCoupon, useCoupon } = require('../controllers/couponController');
const { authMiddleware } = require('../middleware/authMiddleware');

// 获取所有优惠券
router.get('/', getAllCoupons);

// 领取优惠券
router.post('/receive', authMiddleware, receiveCoupon);

// 使用优惠券
router.post('/use', authMiddleware, useCoupon);

module.exports = router;